<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增员工')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-post-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">员工姓名：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="infoName" id="infoName" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">性别：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="infoSex" id="infoSex" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">手机：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="infoPhone" id="infoPhone" required>
            </div>
        </div>

        <div class="form-group">

            <div class="col-md-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">部门名称</label>
                    <div class="col-sm-8">
                        <select class="form-control" name="deptId">
                            <option th:each="personDept:${vos}" th:value="${personDept.deptId}">[[${personDept.deptName}]]</option>
                        </select>

                    </div>
                </div>
            </div>

        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">岗位：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="infoPosition" id="infoPosition" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="infoStatus" id="infoStatus" required>
            </div>
        </div>



        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "person/info";

    $("#form-post-add").validate({
        onkeyup: false,
        rules:{
            // postName:{
            //     remote: {
            //         url: prefix + "/checkTypeNameUnique",
            //         type: "post",
            //         dataType: "json",
            //         data: {
            //             "typeName" : function() {
            //                 return $.common.trim($("#typeName").val());
            //             }
            //         },
            //         dataFilter: function(data, type) {
            //             return $.validate.unique(data);
            //         }
            //     }
            // },

            infoId:{
                digits:true
            },
        },
        // messages: {
        //
        //     "infoName": {
        //         remote: "公告类型名称已经存在"
        //     }
        // },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-post-add').serialize());
        }
    }
</script>
</body>
</html>
